
import { find } from "lodash";

export const getTableColumns = ({ jointTypeList }: { jointTypeList: any }) => [
	{
		title: "接驳点ID",
		dataIndex: "id",
		ellipsis: true
	},
	{
		title: "接驳点名称",
		dataIndex: "name",
		ellipsis: true
	},
	{
		title: "接驳点类型",
		dataIndex: "type",
		ellipsis: true,
		render: (_:any, record: any) => {
			const result = find(jointTypeList, (item: any) => item.value === record.type)
			return (
				<div>
					{ result?.label }
				</div>
			)
		}
	}
];

export const USER_STATUS = [
	{ label: '在线', value: 1 },
	{ label: '离线', value: 2 }
]

export const getSearchColumns = () => [
	{
		type: "input",
		placeholder: "用户名",
		name: "keyword"
	},
	{
		type: "select",
		placeholder: "所属组织",
		name: "keyword"
	},
	{
		type: "input",
		placeholder: "角色",
		name: "keyword"
	},
	{
		type: "select",
		placeholder: "用户状态",
		name: "keyword",
		options: USER_STATUS
	},
]